CREATE TABLE [dbo].[TTCANC_ANUL]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_UNID_CONC] [dbo].[TD_VC_003] NOT NULL,
[CO_CLIE] [dbo].[TD_VC_020] NOT NULL,
[NU_CANJ] [dbo].[TD_VC_008] NOT NULL,
[FE_CANJ] [dbo].[TD_DT_001] NOT NULL,
[FE_ANUL] [dbo].[TD_DT_001] NOT NULL,
[CO_TIPO_OPER] [dbo].[TD_VC_003] NOT NULL,
[ST_CONT] [dbo].[TD_VC_001_INTE] NOT NULL CONSTRAINT [DF__TTCANC_AN__ST_CO__33CA93F7] DEFAULT ('N'),
[NU_PROC] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TTCANC_AN__NU_PR__35B2DC69] DEFAULT ((0)),
[NU_ASTO] [dbo].[TD_VC_010] NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TTCANC_AN__CO_US__36A700A2] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTCANC_AN__FE_US__379B24DB] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TTCANC_AN__CO_US__388F4914] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTCANC_AN__FE_US__39836D4D] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTCANC_ANUL] WITH NOCHECK ADD CONSTRAINT [CK__TTCANC_AN__ST_CO__34BEB830] CHECK NOT FOR REPLICATION (([ST_CONT]='P' OR [ST_CONT]='N'))
GO
ALTER TABLE [dbo].[TTCANC_ANUL] ADD CONSTRAINT [PK__TTCANC_A__2F266C756D0DFE4B] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_UNID_CONC], [CO_CLIE], [NU_CANJ], [FE_CANJ]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTCANC_ANUL] ADD CONSTRAINT [FK__TTCANC_ANUL__42439BD7] FOREIGN KEY ([CO_EMPR], [CO_TIPO_OPER]) REFERENCES [dbo].[TTTIPO_OPER] ([CO_EMPR], [CO_TIPO_OPER])
GO
ALTER TABLE [dbo].[TTCANC_ANUL] ADD CONSTRAINT [FK__TTCANC_ANUL__4337C010] FOREIGN KEY ([CO_EMPR], [CO_UNID_CONC], [CO_CLIE], [NU_CANJ], [FE_CANJ]) REFERENCES [dbo].[TCCANJ_CLIE] ([CO_EMPR], [CO_UNID_CONC], [CO_CLIE], [NU_CANJ], [FE_CANJ])
GO
